# coding:utf-8
import time

from lib.base import Base
from page.android import train_index_page, train_qunar_index_page

__author__ = 'weixin.yuan'


class TrainQunarIndex(Base):
    """去哪儿app跳转火车票"""
    def __init__(self, method_name):
        Base.__init__(self, method_name)
        self.train_ticket_btn = train_qunar_index_page.elements['火车票按钮']
        self.train_ticket_title = train_index_page.elements['火车票title']

    def test_train_qunar_index(self):
        """去哪儿app跳转火车票"""
        self.open_schema_android('0')
        if self.is_exits(self.train_ticket_btn):
            time.sleep(10)
        self.click(self.train_ticket_btn)
        self.check(self.train_ticket_title)
